package com.myhome.money.rabbitmq.moneyrabbitmq.hello;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.myhome.money.rabbitmq.moneyrabbitmq.model.User;

/**
 * @author 许路路
 */
@Component
public class UserSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send() {
        User user = new User();
        user.setName("hzb");
        user.setPass("123456789");
        System.out.println("user send : " + user);
        this.rabbitTemplate.convertAndSend("user", user);
    }


}
